import { createWebHashHistory, createRouter } from 'vue-router'

import Home from '@view/index.vue'
import NotFind from '@view/404/index.vue'
import HomePage from '@view/home-page/index.vue'

import SystemManage from '@view/system-manage/index.vue'
import UserManage from '@view/system-manage/user-manage/index.vue'
import RoleManage from '@view/system-manage/role-manage/index.vue'
import PageManage from '@view/system-manage/page-manage/index.vue'
import ApiManage from '@view/system-manage/api-manage/index.vue'

import FinancialManage from '@view/financial-manage/index.vue'
import FinancialDataOverview from '@view/financial-manage/data-overview/index.vue'

import OrderManage from '@view/order-manage/index.vue'
import OrderList from '@view/order-manage/order-list/index.vue'
import OrderDataOverview from '@view/order-manage/data-overview/index.vue'

import UtilsManage from '@view/utils-manage/index.vue'
import ImageManage from '@view/utils-manage/image-manage/index.vue'
import VideoManage from '@view/utils-manage/video-manage/index.vue'



const routes = [
    {
        path: '/',
        redirect: '/home-page',
        component: Home,
        children: [
            {
                path: '/home-page',
                component: HomePage
            }, {
                path: '/system-manage',
                redirect: '/system-manage/user-manage',
                component: SystemManage,
                children: [
                    {
                        path: '/system-manage/user-manage',
                        component: UserManage
                    },
                    {
                        path: '/system-manage/role-manage',
                        component: RoleManage
                    }, {
                        path: '/system-manage/page-manage',
                        component: PageManage
                    }, {
                        path: '/system-manage/api-manage',
                        component: ApiManage
                    }
                ]
            }, {
                path: '/utils-manage',
                redirect: '/utils-manage/image-manage',
                component: UtilsManage,
                children: [
                    {
                        path: '/utils-manage/image-manage',
                        component: ImageManage
                    },
                    {
                        path: '/utils-manage/video-manage',
                        component: VideoManage
                    }
                ]
            }, {
                path: '/financial-manage',
                redirect: '/financial-manage/data-overview',
                component: FinancialManage,
                children: [
                    {
                        path: '/financial-manage/data-overview',
                        component: FinancialDataOverview
                    }
                ]
            }, {
                path: '/order-manage',
                redirect: '/order-manage/order-list',
                component: OrderManage,
                children: [
                    {
                        path: '/order-manage/order-list',
                        component: OrderList 
                    }, {
                        path: '/order-manage/data-overview',
                        component: OrderDataOverview
                    }
                ]
            }
        ]
    },{
        path: '/:pathMatch(.*)',
        component: NotFind
    }

]

const router = createRouter({
    history: createWebHashHistory(),
    routes,
})

export default router